<?php

namespace App\Http\Controllers\App;

use App\Models\District;
use Illuminate\Http\Request;

class DistrictController extends BaseController
{
    // 获取城市
    public function province()
    {
        return District::where('parent_id', 0)->get(['id', 'name']);
    }

    // 获取城市
    public function city(Request $request)
    {
        return District::where('parent_id', $request->get('id'))->get(['id', 'name']);
    }

}
